<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>宠物管理系统后台登录</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../res/css/font.css" />
	<link rel="stylesheet" href="../res/css/xadmin.css" />
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="../res/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../res/js/xadmin.js"></script>

</head>
<body class="login-bg">

    <div class="login layui-anim layui-anim-up">
        <div id="darkbannerwrap"></div>

        <form>
            <input name="name" id="name" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" />
            <hr class="hr15" />
            <input name="pwd" id="pwd" lay-verify="required" placeholder="密码"  type="password" class="layui-input" />
            <hr class="hr15" />
            <input value="登录"   style="width:100%;" type="submit"  id="adminLogin"/>
            <hr class="hr20" />
        </form>
    </div>

    <script>
        $("#adminLogin").click(function (e) {
            e.preventDefault();
            var name = $("#name").val();
            var pwd = $("#pwd").val();
            $.ajax({
                type:'post',
                url:'user/adminLogin',
                data:{name:name,pwd:pwd},
                success:function(data){
                    if(data == 0){
                        layer.msg("登录成功!")
                        window.location.href = "/adminIndex";
                    }else{
                        layer.msg("账号或者密码错误!");
                    }
                },
                error:function(){
                    layer.msg("Ajax请求失败!")
                }
            })
        })

    </script>
</body>
</html>
